:root {
  --bg:       #0e0e0e;
  --bg2:      #161616;
  --bg3:      #1e1e1e;
  --border:   #2a2a2a;
  --border2:  #3a3a3a;
  --text:     #e8e4dc;
  --muted:    #6a6660;
  --muted2:   #4a4642;
  --accent:   #d4a853;

  --tech:    #5b8dd9;
  --sci:     #6bbf8e;
  --phil:    #c47bbd;
  --math:    #e07c5a;
  --eco:     #4db8a0;
  --geo:     #d4735a;
  --empr:    #a8c45a;
  --links:   #d4a853;

  --mono: 'Martian Mono', monospace;
  --serif: 'Libre Baskerville', Georgia, serif;
  --reading: 'Spectral', Georgia, serif;
  --sans: 'Lato', sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: default;
}

/* GRAIN */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 999;
  opacity: 0.5;
}

/* ── VIEWS ── */
.view { display: none; }
.view.active { display: block; }

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(14,14,14,0.92);
  backdrop-filter: blur(12px);
}
.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.5px;
  cursor: pointer;
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
  cursor: pointer;
  border: none;
  background: none;
}
.nav-links a:hover { color: var(--text); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.hero-inner { max-width: 760px; padding-top: 56px; }

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
  animation: fadeUp 0.8s both;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px; height: 1px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 12px;
}
.hero-name {
  font-family: var(--serif);
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 8px;
  animation: fadeUp 0.8s 0.1s both;
}
.hero-name em { font-style: italic; color: var(--accent); }
.hero-sub {
  font-family: var(--serif);
  font-size: clamp(18px, 2.5vw, 26px);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 48px;
  animation: fadeUp 0.8s 0.2s both;
}
.hero-bio {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.85;
  margin-bottom: 56px;
  animation: fadeUp 0.8s 0.3s both;
}
.hero-bio strong { color: var(--text); font-weight: 400; }
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: fadeUp 0.8s 0.4s both;
}
.tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 2px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s;
}
.tag-tech  { color: var(--tech);  border-color: var(--tech);  }
.tag-sci   { color: var(--sci);   border-color: var(--sci);   }
.tag-phil  { color: var(--phil);  border-color: var(--phil);  }
.tag-math  { color: var(--math);  border-color: var(--math);  }
.tag-eco   { color: var(--eco);   border-color: var(--eco);   }
.tag-geo   { color: var(--geo);   border-color: var(--geo);   }
.tag-empr  { color: var(--empr);  border-color: var(--empr);  }
.tag-links { color: var(--links); border-color: var(--links); }
.tag:hover { background: rgba(255,255,255,0.05); }

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: clamp(1.5rem, 5vw, 4rem);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted2);
  text-transform: uppercase;
  animation: fadeUp 0.8s 0.6s both;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-scroll::after {
  content: '';
  width: 1px; height: 40px;
  background: var(--muted2);
  display: block;
}

/* ── SECTIONS ── */
section {
  padding: clamp(60px, 10vw, 120px) clamp(1.5rem, 5vw, 4rem);
  border-top: 1px solid var(--border);
}
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── INTERESTS GRID ── */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.interest-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px 24px;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.interest-card:hover { background: var(--bg3); }
.interest-icon { font-size: 28px; margin-bottom: 16px; display: block; }
.interest-name { font-family: var(--serif); font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.interest-desc { font-size: 13px; color: var(--muted); line-height: 1.65; }
.interest-count { font-family: var(--mono); font-size: 10px; margin-top: 20px; letter-spacing: 1px; }

.interest-card.tech  { border-top: 2px solid var(--tech);  }
.interest-card.sci   { border-top: 2px solid var(--sci);   }
.interest-card.phil  { border-top: 2px solid var(--phil);  }
.interest-card.math  { border-top: 2px solid var(--math);  }
.interest-card.eco   { border-top: 2px solid var(--eco);   }
.interest-card.geo   { border-top: 2px solid var(--geo);   }
.interest-card.empr  { border-top: 2px solid var(--empr);  }
.interest-card.tech  .interest-name  { color: var(--tech);  }
.interest-card.sci   .interest-name  { color: var(--sci);   }
.interest-card.phil  .interest-name  { color: var(--phil);  }
.interest-card.math  .interest-name  { color: var(--math);  }
.interest-card.eco   .interest-name  { color: var(--eco);   }
.interest-card.geo   .interest-name  { color: var(--geo);   }
.interest-card.empr  .interest-name  { color: var(--empr);  }
.interest-card.tech  .interest-count { color: var(--tech);  }
.interest-card.sci   .interest-count { color: var(--sci);   }
.interest-card.phil  .interest-count { color: var(--phil);  }
.interest-card.math  .interest-count { color: var(--math);  }
.interest-card.eco   .interest-count { color: var(--eco);   }
.interest-card.geo   .interest-count { color: var(--geo);   }
.interest-card.empr  .interest-count { color: var(--empr);  }

/* ── ARTICLES LIST ── */
.articles-grid { display: grid; gap: 0; }
.article-item {
  background: var(--bg);
  padding: 28px 0;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 24px;
  align-items: start;
  cursor: pointer;
  transition: background 0.18s;
  border-bottom: 1px solid var(--border);
}
.article-item:hover { background: var(--bg2); }
.article-item.has-cover {
  grid-template-columns: 64px 180px 1fr auto;
}
.article-num { font-family: var(--mono); font-size: 11px; color: var(--muted2); padding-top: 4px; }
.article-cover-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.article-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-topic {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.article-title-list {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 8px;
}
.article-excerpt {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.article-date-list { font-family: var(--mono); font-size: 10px; color: var(--muted2); white-space: nowrap; padding-top: 4px; }

.topic-tech  { color: var(--tech); }
.topic-sci   { color: var(--sci);  }
.topic-phil  { color: var(--phil); }
.topic-math  { color: var(--math); }
.topic-eco   { color: var(--eco);  }
.topic-geo   { color: var(--geo);  }
.topic-empr  { color: var(--empr); }
.topic-geral { color: var(--muted);}

.articles-empty { padding: 80px 0; text-align: center; }
.articles-empty p { font-family: var(--mono); font-size: 12px; color: var(--muted2); letter-spacing: 1px; }

/* ── LINKS ── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.link-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.link-item:hover { background: var(--bg3); border-color: var(--border2); }
.link-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 6px; }
.link-label { font-family: var(--mono); font-size: 12px; color: var(--text); margin-bottom: 4px; font-weight: 400; }
.link-desc { font-size: 12px; color: var(--muted); }
.link-url { font-family: var(--mono); font-size: 10px; color: var(--muted2); margin-top: 6px; display: block; }
.links-empty { font-family: var(--mono); font-size: 12px; color: var(--muted2); letter-spacing: 1px; }

/* ── FOOTER ── */
.footer {
  padding: 40px clamp(1.5rem,5vw,4rem);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.5px;
}

/* ── BACK BUTTON ── */
.back-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  margin-bottom: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}
.back-btn:hover { color: var(--text); }

/* ── CATEGORY VIEW ── */
#view-category { padding-top: 56px; min-height: 100vh; }
.category-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) clamp(1.5rem, 5vw, 4rem);
}
.category-header {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 64px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}
.category-icon-lg {
  font-size: 52px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 4px;
}
.category-title {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.category-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.75;
  font-weight: 300;
}

/* ── ARTICLE READ VIEW ── */
#view-article { padding-top: 56px; min-height: 100vh; }
.article-read-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(44px, 8vw, 84px) clamp(2.25rem, 8vw, 6.5rem);
}
.read-topic {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.read-title {
  max-width: 760px;
  font-family: var(--sans);
  font-size: clamp(42px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.6px;
  margin-bottom: 22px;
  color: var(--text);
}
.read-date { font-family: var(--mono); font-size: 11px; color: var(--muted2); margin-bottom: 62px; }
.read-divider { width: 40px; height: 1px; background: var(--accent); margin-bottom: 48px; }
.read-body {
  max-width: 760px;
  font-family: var(--reading);
  font-size: clamp(19px, 1.75vw, 21px);
  line-height: 1.68;
  letter-spacing: 0;
  color: #f1ede7;
  font-weight: 400;
}
.read-body p {
  margin-bottom: 1.75em;
}
.article-section-title {
  max-width: 760px;
  font-family: var(--sans);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 700;
  color: var(--text);
  margin: 1.9em 0 0.7em;
}
.article-subtitle {
  max-width: 760px;
  font-family: var(--reading);
  font-size: clamp(22px, 2vw, 24px);
  line-height: 1.55;
  color: var(--text);
  font-style: normal;
  font-weight: 400;
  margin-bottom: 1.9em;
}
.article-figure {
  max-width: 760px;
  margin: 46px 0 56px;
}
.article-figure img {
  width: 100%;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg2);
}
.article-figure figcaption {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.3px;
  color: var(--muted2);
  text-align: center;
}
.read-body strong { color: var(--text); font-weight: 400; }

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .article-item { grid-template-columns: 1fr; gap: 8px; }
  .article-item.has-cover { grid-template-columns: 1fr; }
  .article-num, .article-date-list { display: none; }
  .category-header { flex-direction: column; gap: 16px; }
  .article-cover-wrap { margin-bottom: 8px; }
  .article-read-wrap { padding: 32px 24px 56px; }
  .read-body,
  .article-subtitle,
  .article-figure,
  .article-section-title { max-width: 100%; }
  .read-title {
    max-width: 100%;
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1.08;
  }
  .read-body {
    font-size: 18px;
    line-height: 1.72;
  }
  .article-subtitle {
    font-size: 21px;
  }
  .article-section-title {
    font-size: 28px;
  }
}
